﻿<%@ Control Language="c#" AutoEventWireup="false" Inherits="Web.Control.WWW.Resources.ResListAdmin" %>
<script>
var C0050 = "<%=GetText("C0050")%>";
var C0053 = "<%=GetText("C0053")%>";
var M0011 = "<%=GetText("M0011")%>";
var RS025 = "<%=GetText("RS025")%>";
var RS036 = "<%=GetText("RS036")%>";
var RS037 = "<%=GetText("RS037")%>";
var RS038 = "<%=GetText("RS038")%>";
var RS039 = "<%=GetText("RS039")%>";
var RS042 = "<%=GetText("RS042")%>";
var RS043 = "<%=GetText("RS043")%>";
var RS044 = "<%=GetText("RS044")%>";
var RS049 = "<%=GetText("RS049")%>";
var GP033 = "<%=GetText("GP033")%>";
var C1008 = "<%=GetText("C1008")%>";
var GP066 = "<%=GetText("GP066")%>";
var C0069 = '<%=GetText("C0069")%>';
var gCancel = "<%=GetText("C0056")%>";
</script>
<div class="common">
	<div id="new_body">
		<div id="body_900">
				<div class="submenu3"></div>
			<div id="body_left"></div>
			<div id="body_main">
				<div class="submenuN">
					<div class="submenuN_position">
						<div class="submenuN_title">
							<div class="submenuN_Btitle">
								<h1><%=ResPage.PageTitle%></h1>
								<div class="copyright"><a href="/resources/">$M0011$</a> > <a href="/resources/<%=ResPage.PageID%>/learn_<%=LearnL%>_in_<%=SpeakL%>.htm"><%=GetText("RS004",new string[]{GetLanguageText(LearnL),GetLanguageText(SpeakL)})%></a> > $RS036$</div>
							</div>
							<div class="submenuN_button"></div>
						</div>
					</div>
				</div>
				<div class="Center9001n">
					<div class="Center9001Left">
						<div class="right_layerA">
							<div class="layer_contentA">
								<h4>Category</h4>
								<div class="layer_contentA5">
								<asp:Repeater ID="rptCat" runat="server">
								<HeaderTemplate>
								<div class="resources_admin_cate">
									<ul class="">
										</HeaderTemplate>
										<ItemTemplate>
										<li><a href='<%#Eval("ID","#Cat{0}") %>'><%#Eval("Catname")%></a></li>
										</ItemTemplate>
										<FooterTemplate>
									</ul>
									<div class="clear"></div>
								</div>
								</FooterTemplate>
								</asp:Repeater>
								</div>
							</div>
						</div>
						<div class="right_layerA">
							<div class="layer_contentA"><H4>$RS036$</H4><br />
								<p><a href="/resources/<%=ResPage.PageID%>/learn_<%=LearnL%>_in_<%=SpeakL%>.htm">$RS037$</a></p>
							</div>
						</div>						
					</div>
					<div class="Center9001Right">
						<div class="Center9001content">
							<!--Category loop start-->
							<div class="resources_list_area">
								<div id="ResourcesID">
								    <asp:Repeater ID="rptCatForRes" runat="server">
									    <ItemTemplate>
										    <div class="margin20">
											    <a name='<%#Eval("ID","Cat{0}") %>'></a>
											    <h3><%#Eval("Catname")%></h3>
											    <a id="lbtAdd" href="javascript:AddRes(<%#Eval("ID")%>)"><img src="/Images/icon_res_add.gif" align="absmiddle" border="0" title="$RS036$" alt="" /> $RS038$</a>
											    <div id="ResL<%#Eval("ID")%>">
											        <asp:Repeater ID="rptResbyCat" runat="server" DataSource='<%#GetResDataSource(Eval("ID"))%>'>
												        <ItemTemplate>
												        <ul class="resource">
													        <li>
													            <a href="javascript:EditRes(<%#Eval("ResID") %>,<%#Eval("CateID") %>)"><img src="/Images/icon_res_edit.gif" align="absmiddle" border="0" title="$C0053$" /></a> 
													            <a href="javascript:void(0)" onclick="javascript:DeleteRes(<%#Eval("ResID") %>,<%#Eval("CateID") %>)"><img src="/Images/icon_res_delete.gif" align="absmiddle" border="0" title="$C0050$" /></a> 
													            <a href="javascript:RaiseRes(<%#Eval("ResID") %>,<%#Eval("CateID") %>)"><img src="/Images/icon_res_raise.gif" align="absmiddle" border="0" title="$RS039$" /></a> 
													            <a href="javascript:DisableEnable(<%#Eval("ResID") %>,<%#Eval("CateID") %>,<%#((bool)Eval("Active"))?1:0%>)"><%#(((bool)Eval("Active"))?"<img src='/Images/icon_res_enable.gif' align='absmiddle' border='0' title='"+GetText("RS040")+"'  />":"<img src='/Images/icon_res_disable.gif' align='absmiddle' border='0' title='"+GetText("RS041")+"' />")%></a> 														        
														        <a href='<%#Eval("Url","{0}")%>' ><%#Eval("Name") %></a> - <%#Eval("Description")%>
													        </li>
													    </ul>
												        </ItemTemplate>
											        </asp:Repeater>
											    </div>
										    </div>
									    </ItemTemplate>
								    </asp:Repeater>
								    <div>
								        <div><h3>$RS042$</h3></div>
								        <div id="ResL0">
								        <asp:Repeater ID="rptUserRecommanded" runat="server">
									        <ItemTemplate>
									        <ul class="resource">
										        <li>
										            <a href="javascript:EditRes(<%#Eval("ResID") %>,<%#Eval("CateID") %>)"><img src="/Images/icon_res_edit.gif" align="absmiddle" border="0" title="<%=GetText("M0016")%>" /></a> 
										            <a  href="javascript:void(0)" onclick="javascript:DeleteRes(<%#Eval("ResID") %>,<%#Eval("CateID") %>)"><img src="/Images/icon_res_delete.gif" align="absmiddle" border="0" title="<%=GetText("GP033")%>" /></a> 
											        <a href='<%#Eval("Url","{0}")%>' ><%#Eval("Url")%></a> - <%#Eval("Description") %>
										        </li>
										    </ul>
									        </ItemTemplate>
								        </asp:Repeater>
								        </div>
								    </div>
								</div>
								<div id="plhEdit" style="display:none">
									<h3>$RS043$</h3>
									<p><strong>$RS044$:</strong><br /><input type="text" id="txtName" class="common300" /><span name="__V_S" vt="0" elt1="txtName" reg=".{1,50}" style="color:Red;display:none" class="validMsg"><br /><%=GetText("RS045")%></span></p>
									<p><strong>$RS025$:</strong><br /><input type="text" id="txtUrl" class="common300" /><span name="__V_S" vt="0" elt1="txtUrl" reg="\http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=~]*)?" style="color:Red;display:none" class="validMsg"><br /><%=GetText("RS027")%></span></p>
									<p><strong>$RS049$:</strong><br /><select id="CatSelect"><option value="0"> </option><%=GetResourceCatSelect("")%></select></p>										
									<p><strong>$GP033$:</strong><br /><textarea id="txtDes" class="common300" cols="" rows=""></textarea><span name="__V_S" vt="0" elt1="txtDes" reg="[\s\S]{0,1000}" style="color:Red;display:none" class="validMsg"><br /><%=GetText("C1010")%></span></p>
									<p><input type="button" id="btnSubmit" value="<%=GetText("C0055")%>" class="button" onclick="Save()" />&nbsp;&nbsp;<input type="button" id="" value="<%=GetText("C0056")%>" class="buttong" onclick="HiddenOrShow(1)" />										
									</p>
								</div>			
							</div>
						</div>
					</div>
					<div class="clear"></div>
				</div>
				<script>
					var gbody_main = document.getElementById("body_main").innerHTML;
						gbody_main = gbody_main.replace(/\$C0050\$/gi,C0050).replace(/\$C0053\$/gi,C0053).replace(/\$M0011\$/gi,M0011).replace(/\$RS036\$/gi,RS036).replace(/\$RS037\$/gi,RS037).replace(/\$RS038\$/gi,RS038).replace(/\$RS039\$/gi,RS039);
						gbody_main = gbody_main.replace(/\$RS042\$/gi,RS042).replace(/\$RS043\$/gi,RS043).replace(/\$RS044\$/gi,RS044).replace(/\$RS025\$/gi,RS025).replace(/\$RS049\$/gi,RS049).replace(/\$GP033\$/gi,GP033);
						document.getElementById("body_main").innerHTML = gbody_main;
						gbody_main=null;
				</script>
			</div>
			<div id="body_right"></div>
			<div class="clear"></div>
		</div>
		<div id="body_900F"></div>
	</div>
</div>
<div id="ResLItem" style="display:none">
    <ul id="resource">
    <li>
        <a href="javascript:EditRes($ResID$,$CateID$)"><img src="/Images/icon_res_edit.gif" align="absmiddle" border="0" title="<%=GetText("C0053")%>" /></a> 
        <a href="javascript:void(0)" onclick="javascript:DeleteRes($ResID$,$CateID$)"><img src="/Images/icon_res_delete.gif" align="absmiddle" border="0" title="<%=GetText("C0050")%>" /></a> 
        <a href="javascript:RaiseRes($ResID$,$CateID$)"><img src="/Images/icon_res_raise.gif" align="absmiddle" border="0" title="<%=GetText("RS039")%>" /></a> 
        <a href="javascript:DisableEnable($ResID$,$CateID$,$BActive$)">$Active$</a>
        <a href='$Url$' >$Name$</a> - $Description$
    </li>
    </ul>   
</div>
<div id="ResL0Item" style="display:none">
    <ul id="resource">
        <li>
            <a href="javascript:EditRes($ResID$,$CateID$)"><img src="/Images/icon_res_edit.gif" align="absmiddle" border="0" title="<%=GetText("C0053")%>" /></a> 
            <a href="javascript:void(0)" onclick="javascript:DeleteRes($ResID$,$CateID$)"><img src="/Images/icon_res_delete.gif" align="absmiddle" border="0" title="<%=GetText("C0050")%>" /></a> 
            <a href='$Url$' >$Url$</a> - $Description$
        </li>
    </ul>    
</div>
<%--
<div id="DeletePanel" class="modalPopup DisplayNone" style="display: none">
    <div id="DeletePanelTitle">
        <div class="Popup_Title"><%=GetText("C1008")%></div>
		<div class="Popup_windows"><%=GetText("GP066")%></div>
    </div>
    <div><p style="text-align: center;"><input type="button" value="<%=GetText("C0069")%>" id="OkButton5" class="button" /> <input type="button" value="<%=GetText("C0056")%>" id="CancelButton5" class="buttong" /></p></div>
</div>
var Page_Validators =  new Array($get("valtxtName"),$get("valtxtUrl"), $get("valtxtDes"));
var TmpObj = $get("valtxtName");
TmpObj.controltovalidate = "txtName";
TmpObj.errormessage = "<b><%=GetText("RS045")%></b>";
TmpObj.display = "None";
TmpObj.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
TmpObj.validationexpression = ".{1,50}";

TmpObj = $get("valtxtUrl");
TmpObj.controltovalidate = "txtUrl";
TmpObj.errormessage = "<b><%=GetText("RS027")%></b>";
TmpObj.display = "None";
TmpObj.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
TmpObj.validationexpression = "\\http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=~]*)?";

TmpObj = $get("valtxtDes");
TmpObj.controltovalidate = "txtDes";
TmpObj.errormessage = "<b><%=GetText("C1010")%></b>";
TmpObj.display = "None";
TmpObj.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
TmpObj.validationexpression = "[\\s\\S]{0,1000}";

var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
    ValidatorOnLoad();
}
function ValidatorOnSubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommonOnSubmit();
    }
    else {
        return true;
    }
}
function CreateValid()
{
    $create(AjaxControlToolkit.ValidatorCalloutBehavior, 
    {"closeImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/close.gif","highlightCssClass":"validatorCalloutHighlight",
     "id":"valtxtName","warningIconImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/alert-small.gif"}, null, null, $get("valtxtName"));
    $create(AjaxControlToolkit.ValidatorCalloutBehavior, 
    {"closeImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/close.gif","highlightCssClass":"validatorCalloutHighlight",
     "id":"valtxtUrl","warningIconImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/alert-small.gif"}, null, null, $get("valtxtUrl"));
    $create(AjaxControlToolkit.ValidatorCalloutBehavior, 
    {"closeImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/close.gif","highlightCssClass":"validatorCalloutHighlight",
     "id":"valtxtDes","warningIconImageUrl":"<%=RootPath%>Scripts/AjaxTools/images/alert-small.gif"}, null, null, $get("valtxtDes"));    
}
<span id="valtxtName" style="color: Red; display: none;" class="red10"></span>
<span id="valtxtUrl" style="color: Red; display: none;" class="red10"></span>
<span id="valtxtDes" style="color: Red; display: none;" class="red10"></span>--%>
<script>
var Memberno = "<%=memberno %>";
var PageID = <%=ResPage.PageID %>;
var LanLearn = "<%=LearnL %>";
var LanBase = "<%=SpeakL %>";
</script>